<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>登录 - 高平市农产品质量安全监管系统</title>
<link href="${path }/res/css/bootstrap.min.css" rel="stylesheet">
<link href="${path}/res/js/jNotify/jNotify.jquery.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="${path }/res/css/login.css">
</head>
<body>
<section>
    <div class="back back_img">
        <div class="login">
            <img class="logo" src="${path }/res/img/login_logo.png" />
            <div class="login_wrap">
                <p>登录|User Login</p>
                <div class="denglu">
                    <img src="${path }/res/img/yonghu.png">
                    <input type="text" id="loginname" name="loginname" placeholder="用户名" />
                </div>
                <div class="denglu">
                    <img src="${path }/res/img/mima.png">
                    <input type="password" name="passwd" id="passwd" placeholder="密码" />
                </div>
                <div class="denglu denglu1">
                    <div class="box" style="width: 50%; display:inline-block;float: left;">
                        <img src="${path }/res/img/yanzhengma.png" />
                        <input style="width:50%;" type="text" name="captcha" id="captcha" placeholder="验证码">
                    </div>
                    <div id="v_container">
                    <img src="${path}/public/kaptcha.do" title="点击更换验证码" id="captchaImg" onclick="setCaptcha();" />
                    </div>
                </div>
                <button type="button" class="btn" id="my_button">登 录</button>
            </div>
        </div>
    </div>
    <div class="footer">
        Copyright © 2017 - 2018 QingXin. All Rights Reserved
    </div>
</section>
<script src="${path}/res/js/jquery-1.12.4.min.js" type="text/javascript"></script>
<script src="${path}/res/js/jquery.form.js" type="text/javascript"></script>
<script src="${path}/res/js/jNotify/jNotify.jquery.js" type="text/javascript"></script>
<script src="${path }/res/adminui/js/layer/layer.js" type="text/javascript"></script>
<script src="${path}/res/js/ui.util.js" type="text/javascript"></script>
<script src="${path}/res/js/login.js" type="text/javascript"></script>
<script type="text/javascript">
var qxLogin;
$(function(){
	$('#loginname').val('');
	$('#captcha').val('');
	$('#loginname').focus();
	qxLogin = new QxLogin({
		url: "${path}/admin/login.json",
		loginname: $('#loginname'),
		passwd: $('#passwd'),
		captcha: $('#captcha'),
		callback: function(state){
			if(state){
				//location.href = "${path}/admin/index.do";
			}else{
				setCaptcha();
			}
		}
	});
	//绑定回车事件
	$('body').bind('keyup', function(event) {
		if(event.keyCode == 13 && $("#captcha").val().length>=4){
			qxLogin.doLogin();
		}
	});
	
	$("#my_button").click(function() {
		qxLogin.doLogin();
		return false;
	});
	
});

//验证码图片切换
function setCaptcha() {
	$('#captchaImg').attr('src', '${path}/public/kaptcha.do?' + Math.random());
	$('#captcha').val('').focus();
}

</script>

</body>
</html>
